package com.marui.eight.demo1;

/**
 * @author marui
 * @version 1.0
 * @date 2021/6/12 12:29 下午
 * @since 1.0
 */
public class TestClient {
    public static void main(String[] args) {
        Emp emp = new Emp();

        // 原始方法
        Salary salary = new Salary(){

            @Override
            public Boolean checkLegal() {
                System.out.println("checkLegal");
                return false;
            }
        };
        emp.say2(0,salary);


        System.out.println("---------------");

        // 新方法
        emp.say2(1, new Salary() {

            @Override
            public Boolean checkLegal() {
                System.out.println("checkLegal");
                return false;
            }
        });

    }
}
